﻿using Max.PH4_2104A.Shopping.DAL;
using Max.PH4_2104A.Shopping.Domain;
using Max.PH4_2104A.Shopping.IRepository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.PH4_2104A.Shopping.Repository
{
    /// <summary>
    /// 分类的仓储实现
    /// </summary>
    public class CategoryRepository : ICategoryRepository
    {
        MyDbContext _context;
        /// <summary>
        /// 构造函数注入
        /// </summary>
        /// <param name="context"></param>
        public CategoryRepository(MyDbContext context)
        {
            _context = context;
        }

        public void Delete(CategoryModel model)
        {
            throw new NotImplementedException();
        }

        public IQueryable<CategoryModel> GetAll()
        {
            return _context.Categories;
        }

        public void Insert(CategoryModel model)
        {
            _context.Categories.Add(model);
        }

        public void Update(CategoryModel model)
        {
            throw new NotImplementedException();
        }
    }
}
